package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 系统功能表
 * </p>
 *
 * @author stylefeng
 * @since 2018-08-31
 */

@Data
@EqualsAndHashCode(callSuper=true)
@TableName("sys_function")
@ApiModel(value="系统功能实体",description = "系统功能实体")
public class Function extends Model<Function> {

    private static final long serialVersionUID = 1L;

    /**
     * 功能编号
     */
    @TableId(value = "sf_id", type = IdType.AUTO)
    @ApiModelProperty(value = "功能编号",required = true)
    private Integer sfId;

    /***
     *菜单编号
     */
    @NotBlank(message="菜单编号不能为空")
    @ApiModelProperty(value = "菜单编号",required = true)
    @TableField("sf_code")
    private String sfCode;

    public Integer getSfId() {
        return sfId;
    }

    public void setSfId(Integer sfId) {
        this.sfId = sfId;
    }

    /**

     * 菜单父编号
     */
    @TableField("sf_pcode")
    private String sfPcode;

    /***
     * 菜单父编号集
     */
    @TableField("sf_pcodes")
    private String sfPcodes;

    /**
     * 功能名称
     */
    @NotBlank(message = "功能名称不能为空")
    @ApiModelProperty(value = "功能名称",required = true)
    @TableField("sf_name")
    private String sfName;
    /**
     * 父功能
     */
    @ApiModelProperty(value = "父功能ID",required = true)
    @TableField("sf_pid")
    private Integer sfPid;
    /**
     * 当前菜单所有父功能编号
     */
    @TableField("sf_pids")
    private String sfPids;
    /**
     * 功能地址
     */
    @NotBlank(message="功能地址不能为空")
    @ApiModelProperty(value = "功能地址",required = true)
    @TableField("sf_url")
    private String sfUrl;
    /**
     * 功能图标
     */
    @TableField("sf_icon")
    @ApiModelProperty(value = "功能图标",required = true)
    private String sfIcon;
    /**
     * 功能状态
     */
    @TableField("sf_state")
    private Integer sfState;
    /**
     * 功能排序
     */
    @TableField("sf_sort")
    private Integer sfSort;
    /**
     * 是否打开
     */
    @TableField("sf_isopen")
    private String sfIsopen;
    /**
     * 是否是菜单(0:否,1:是)
     */
    @NotBlank(message = "是否是菜单不能为空")
    @ApiModelProperty(value = "是否是菜单",required = true)
    @TableField("sf_ismenu")
    private String sfIsmenu;
    /**
     * 菜单排序号
     */
    @TableField("sf_num")
    private Integer sfNum;
    /**
     * 菜单层级
     */
    @ApiModelProperty(value = "菜单层级",required = true)
    @TableField("sf_level")
    private Integer sfLevel;
    /**
     * 备注
     */
    @TableField("sf_tips")
    @ApiModelProperty(value = "备注",required = true)
    private String sfTips;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 更新人
     */
    @TableField("update_by")
    private String updateBy;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 创建人
     */
    @TableField("create_by")
    private String createBy;

    @Override
    protected Serializable pkVal() {
        return this.sfId;
    }


}
